package com.ruoyi.app.controller.account;

import com.ruoyi.app.business.account.CompanyAccountBusiness;
import com.ruoyi.app.config.annotation.OperationAuth;
import com.ruoyi.common.core.web.domain.APIResult;
import com.ruoyi.service.user.enums.UserTypeEnum;
import java.math.BigDecimal;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 公司账户管理
 *
 * @author Zane
 * @since 2025-09-27
 */
@RestController
@RequestMapping("/account/company")
public class CompanyAccountController {

  @Resource
  private CompanyAccountBusiness companyAccountBusiness;

//  /**
//   * 公司账户信息
//   *
//   */
//  @OperationAuth(value = {UserTypeEnum.DEMANDER_USER}, demanderHasCompanyCheck = false)
//  @GetMapping("info")
//  public APIResult<Void> info() {
////    userBusiness.bindCompany(companyRegister);
//    return APIResult.success();
//  }

  /**
   * 充值
   *
   * @param amount 充值金额
   */
  @OperationAuth(value = {UserTypeEnum.DEMANDER_USER})
  @PutMapping("addFunds")
  public APIResult<Void> addFunds(@RequestParam("amount") BigDecimal amount) {
    companyAccountBusiness.addFunds(amount);
    return APIResult.success();
  }


}
